* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f5f5f5;
    margin: 0;
}

.container {
    max-width: 100%;
    margin: 0;
    padding: 20px;
    position: relative;
}

.bookmarks-grid {
    display: block;
    padding: 0;
}

.folder-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.04);
}

.folder-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: inherit;
    opacity: 0.95;
    z-index: 0;
}

.folder-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.06);
}

.folder-card h3 {
    color: rgba(0,0,0,0.75);
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
    font-weight: 500;
}

.bookmark-item {
    margin: 0;
    height: 100%;
    min-height: 72px;
    background: white;
    border-radius: 10px;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    border: 2px solid transparent;
    background-clip: padding-box;
}

.bookmark-item::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 12px;
    background: var(--border-gradient, linear-gradient(45deg, #12c2e9, #c471ed, #f64f59));
    z-index: -1;
    opacity: 0.3;
    transition: opacity 0.3s ease;
}

.bookmark-item:hover::before {
    opacity: 0.5;
}

.bookmark-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.bookmark-item a {
    color: #333;
    text-decoration: none;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-all;
    line-height: 1.4;
    max-height: 2.8em;
    gap: 12px;
    font-size: 15px;
    font-weight: 500;
    z-index: 1;
}

.bookmark-item a i {
    color: #4CAF50;
    font-size: 16px;
    flex-shrink: 0;
    margin-top: 2px;
}

.bookmark-item a .favicon {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    object-fit: contain;
}

.bookmark-actions {
    position: relative;
    z-index: 1;
    flex-shrink: 0;
    margin-left: 12px;
    padding-top: 2px;
}

.bookmark-action-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 16px;
    transition: all 0.2s;
}

.bookmark-edit-button {
    color: #999;
}

.bookmark-edit-button:hover {
    background-color: rgba(33, 150, 243, 0.1);
    color: #2196F3;
}

.bookmark-delete-button {
    color: #999;
}

.bookmark-delete-button:hover {
    background-color: rgba(244, 67, 54, 0.1);
    color: #f44336;
}

#breadcrumb {
    margin: 0 0 20px 0;
    padding: 15px 20px;
    background: white;
    border-radius: 5px;
    font-size: 16px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.breadcrumb-item {
    display: inline-block;
    cursor: pointer;
    color: #2196F3;
    margin-right: 10px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.breadcrumb-item:hover {
    background-color: rgba(33, 150, 243, 0.1);
}

.breadcrumb-item:not(:last-child)::after {
    content: ">";
    margin-left: 10px;
    color: #999;
    font-weight: normal;
}

.breadcrumb-item:last-child {
    color: #333;
    font-weight: 600;
}

/* 新建分类卡片样式 */
.create-folder {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(240, 240, 240, 0.8)) !important;
    border: 2px dashed rgba(33, 150, 243, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.create-folder::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(33, 150, 243, 0.05),
        rgba(33, 150, 243, 0.1)
    );
    opacity: 0;
    transition: opacity 0.3s ease;
}

.create-folder:hover {
    border-color: #2196F3;
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(33, 150, 243, 0.1);
}

.create-folder:hover::before {
    opacity: 1;
}

.create-folder h3 {
    color: #2196F3 !important;
    font-size: 16px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 1;
}

.create-folder h3::before {
    content: "+";
    font-size: 24px;
    font-weight: 400;
    opacity: 0.8;
}

/* 新建分类卡片悬浮动画 */
.create-folder:hover h3 {
    transform: scale(1.05);
}

/* 确保新建分类卡片不参与拖拽 */
.create-folder.sortable-ghost,
.create-folder.sortable-chosen,
.create-folder.sortable-drag {
    display: none;
}

.folder-title-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    position: relative;
    z-index: 1;
}

.edit-button {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 16px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
    opacity: 0;
}

.folder-card:hover .edit-button {
    opacity: 1;
}

.edit-button:hover {
    background-color: rgba(0, 0, 0, 0.1);
    color: #2196F3;
}

.button-container {
    margin-left: 12px;
    flex-shrink: 0;
    display: flex;
    gap: 4px;
}

.folder-button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
    opacity: 0;
}

.folder-card:hover .folder-button {
    opacity: 1;
}

.edit-button {
    color: #999;
}

.edit-button:hover {
    background-color: rgba(33, 150, 243, 0.1);
    color: #2196F3;
}

.delete-button {
    color: #999;
    font-size: 18px;
}

.delete-button:hover {
    background-color: rgba(244, 67, 54, 0.1);
    color: #f44336;
}

.title-area {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    width: 100%;
    overflow: hidden;
}

.title-area i {
    font-size: 24px;
    margin-right: 12px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.title-area h3 {
    margin: 0;
    color: rgba(0, 0, 0, 0.75);
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.folder-stats {
    position: relative;
    z-index: 1;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(0,0,0,0.06);
    display: flex;
    gap: 20px;
}

.stat-item {
    background: rgba(255,255,255,0.65);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    margin-right: 8px;
    color: rgba(0,0,0,0.6);
}

.stat-item i {
    font-size: 14px;
    transition: color 0.3s ease;
}

/* 顶部栏样式 */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 0 20px;
    gap: 20px;
}

/* 搜索区域样式 */
.search-wrapper {
    flex: 1;
    max-width: 600px;
    min-width: 200px;
    position: relative;
}

/* 搜索框样式 */
.search-box {
    width: 100%;
    background: white;
    border-radius: 10px;
    padding: 12px 15px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    border: 1px solid rgba(33, 150, 243, 0.1);
    transition: all 0.3s ease;
}

.search-box:focus-within {
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.15);
    border-color: #2196F3;
}

.search-icon {
    color: #2196F3;
    font-size: 16px;
    margin-right: 10px;
}

#searchInput {
    flex: 1;
    border: none;
    outline: none;
    font-size: 15px;
    color: #333;
    background: transparent;
}

#searchInput::placeholder {
    color: #999;
}

/* 搜索结果容器样式 */
.search-results {
    position: absolute;
    top: calc(100% + 8px);  /* 搜索框下方8px */
    left: 0;
    right: 0;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    border: 1px solid rgba(33, 150, 243, 0.1);
}

/* 搜索结果项样式 */
.search-result-item {
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.search-result-item:hover {
    background-color: rgba(33, 150, 243, 0.05);
}

.search-result-item .favicon {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

.search-result-item .title {
    flex: 1;
    font-size: 14px;
    color: #333;
}

.search-result-item .url {
    font-size: 12px;
    color: #666;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 搜索结果组样式 */
.search-result-group {
    padding: 8px 15px;
    font-size: 13px;
    color: #666;
    font-weight: 500;
    background: #f8f8f8;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-result-group i {
    color: #2196F3;
}

/* 搜索结果链接样式 */
.search-result-item a {
    flex: 1;
    text-decoration: none;
    color: #333;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-all;
    line-height: 1.4;
    max-height: 2.8em;
}

/* 搜索结果图标样式 */
.search-result-item .favicon {
    width: 16px;
    height: 16px;
    margin-right: 10px;
    flex-shrink: 0;
    object-fit: contain;
}

/* 搜索结果路径样式 */
.search-result-path {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
    display: block;
}

/* 搜索结果悬停效果 */
.search-result-item:hover {
    background-color: #f5f5f5;
}

/* 搜索结果容器样式优化 */
.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    margin-top: 5px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
}

/* 搜索结果滚动条美化 */
.search-results::-webkit-scrollbar {
    width: 8px;
}

.search-results::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.search-results::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.search-results::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* 搜索结果动画 */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-results.show {
    display: block;
    animation: slideDown 0.3s ease;
}

/* 空结果状态 */
.search-result-empty {
    padding: 30px;
    text-align: center;
    color: #666;
}

.search-result-empty i {
    font-size: 24px;
    color: #999;
    margin-bottom: 10px;
}

.search-result-empty p {
    font-size: 14px;
    margin: 5px 0;
}

/* 编辑对话框样式 */
.edit-dialog {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.edit-dialog-content {
    background: white;
    padding: 24px;
    border-radius: 8px;
    width: 400px;
    max-width: 90%;
}

.edit-dialog h3 {
    margin: 0 0 20px 0;
    color: #333;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #666;
}

.form-group input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-group input:focus {
    outline: none;
    border-color: #2196F3;
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.1);
}

.dialog-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}

.dialog-buttons button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.save-button {
    background-color: #2196F3;
    color: white;
}

.save-button:hover {
    background-color: #1976D2;
}

.cancel-button {
    background-color: #f5f5f5;
    color: #666;
}

.cancel-button:hover {
    background-color: #e0e0e0;
}

/* 修改书签按钮样式 */
.bookmark-button.edit-button {
    color: #999;
}

.bookmark-button.edit-button:hover {
    background-color: rgba(33, 150, 243, 0.1);
    color: #2196F3;
}

/* 信息面板样式 */
.info-panel {
    flex-shrink: 0;
}

/* 日期时间容器样式 */
.datetime-container {
    background: linear-gradient(135deg, #fff, #f8f8f8);
    padding: 12px 15px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border: 1px solid rgba(33, 150, 243, 0.1);
    position: relative;
    overflow: hidden;
}

.datetime-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.15);
    border-color: rgba(33, 150, 243, 0.2);
}

.datetime-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #2196F3, #64B5F6);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.datetime-container:hover::before {
    opacity: 1;
}

/* 时间样式 */
.time {
    font-size: 28px;
    font-weight: 600;
    color: #2196F3;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 2px;
    font-family: 'Arial', sans-serif;
    letter-spacing: 0.5px;
}

/* 添加时间分隔符动画 */
.time::after {
    content: '';
    width: 4px;
    height: 4px;
    background: #2196F3;
    border-radius: 50%;
    margin-left: 2px;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* 日期样式 */
.date {
    font-size: 14px;
    color: #555;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
}

.date::before {
    content: '📅';
    font-size: 12px;
    opacity: 0.8;
}

/* 农历日期样式 */
.lunar-date {
    font-size: 13px;
    color: #666;
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px dashed rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 5px;
}

.lunar-date::before {
    content: '🌙';
    font-size: 12px;
    opacity: 0.8;
}

/* 添加渐变动画 */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.datetime-container:hover {
    background: linear-gradient(135deg, 
        rgba(33, 150, 243, 0.05),
        rgba(33, 150, 243, 0.1),
        rgba(33, 150, 243, 0.05)
    );
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
}

.folder-card:hover .title-area i {
    transform: scale(1.1);
}

.folder-button.edit-button {
    color: #2196F3;
}

.folder-button.delete-button {
    color: #f44336;
}

.folder-button:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* 分类网格布局 */
.folders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding-top: 10px;
}

/* 书签列表布局 */
.bookmarks-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 10px;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

/* 拖拽相关样式 */
.sortable-ghost {
    opacity: 0.4;
    background: #f0f0f0 !important;
}

.sortable-chosen {
    cursor: move;
}

.sortable-drag {
    opacity: 0.9;
    transform: scale(1.05);
}

/* 添加长按提示 */
.folder-card {
    touch-action: none;  /* 防止移动端长按选择文本 */
}

/* 添加拖动手柄样式 */
.folder-card:active {
    cursor: move;
    cursor: grabbing;
}

/* 书签拖拽相关样式 */
.bookmark-item {
    cursor: move;
    touch-action: none;
}

.bookmark-item.sortable-ghost {
    opacity: 0.4;
    background: #f0f0f0 !important;
}

.bookmark-item.sortable-chosen {
    background: #fff;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.bookmark-item.sortable-drag {
    opacity: 0.9;
    transform: scale(1.02);
    background: #fff;
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
}

/* 防止拖拽时触发链接点击 */
.bookmark-item a {
    pointer-events: none;
}

/* 仅在非拖拽状态下允许链接点击 */
.bookmark-item:not(.sortable-chosen) a {
    pointer-events: auto;
}

/* 书签操作按钮容器 */
.bookmark-actions-container {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.action-button {
    background: white;
    border: none;
    padding: 8px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    color: #2196F3;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.action-button:hover {
    background: #f8f8f8;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.action-button i {
    font-size: 16px;
}

.import-button {
    background: #2196F3;
    color: white;
}

.import-button:hover {
    background: #1976D2;
}

/* 文件输入框隐藏 */
#importInput {
    display: none;
}

/* 顶部栏样式 */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 0 20px;
    gap: 20px;
}

/* 分类标题 */
.section-title {
    font-size: 16px;
    color: #666;
    margin: 0 0 15px 0;
    padding-left: 10px;
    border-left: 3px solid #2196F3;
}

/* 区域容器样式 */
.section {
    margin-bottom: 30px;
}

/* 分类标题样式 */
.section-title {
    font-size: 16px;
    color: #666;
    margin: 0 0 15px 0;
    padding-left: 10px;
    border-left: 3px solid #2196F3;
}

/* 书签列表布局 */
.bookmarks-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 10px;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

/* 分类网格布局 */
.folders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding-top: 10px;
}

/* 新增书签按钮样式 */
.create-bookmark {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(240, 240, 240, 0.8)) !important;
    border: 2px dashed rgba(33, 150, 243, 0.3) !important;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.create-bookmark::before {
    display: none;
}

.create-bookmark:hover {
    border-color: #2196F3;
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.05), rgba(33, 150, 243, 0.1)) !important;
    transform: translateY(-2px);
}

.create-bookmark .bookmark-content {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #666;
}

.create-bookmark i {
    font-size: 16px;
    color: #2196F3;
}

.create-bookmark span {
    font-size: 14px;
    font-weight: 500;
}

/* 确保新增按钮不参与排序 */
.create-bookmark.sortable-ghost,
.create-bookmark.sortable-chosen,
.create-bookmark.sortable-drag {
    display: none;
}

/* 弹窗样式 */
.dialog-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.dialog-overlay.show {
    display: flex;
}

.dialog-content {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: 400px;
    animation: dialogSlideIn 0.3s ease;
}

.dialog-content h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 18px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #666;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-group input:focus {
    border-color: #2196F3;
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.1);
    outline: none;
}

.dialog-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.dialog-buttons button {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.cancel-button {
    background: #f5f5f5;
    color: #666;
}

.cancel-button:hover {
    background: #eee;
}

.confirm-button {
    background: #2196F3;
    color: white;
}

.confirm-button:hover {
    background: #1976D2;
}

@keyframes dialogSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
 